﻿using System;
using System.Drawing;
using System.Timers;

using DC2010.Objects;
using DC2010.Objects.Base;
using DC2010.Objects.Data;

namespace DC2010.AI
{
    public class AI_Steal : AILogic
    {
        public AI_Steal(AIData ed):base(ed)
        {
            ShortName = "";
            LongName = "";
            Id = "AI_STEAL";
        }

        /// <summary>
        /// In case of steal, we have to steal from someone.
        /// </summary>
        /// <param name="cdAttacker">How is stealing</param>
        /// <param name="cdVictim">Creature who will loose items</param>
        public override void Think(CreatureData cdAttacker, CreatureData cdVictim = null)
        {
            base.Think(cdAttacker);
			
            ////code is basically designed for stealing from me(by giggler...?)
            ////so in same way i can steal from monster, who is in my engine creature too.
			
            //// param
            //// set fear after steal....
			
			
            //int D0L, D0W, D1L, D1W, D5L, D5W, D6W, D6L, D7L, D7W;
            //  RN objD4;
            //  CreatureData pcA2;
            //  i16      w_2;
            ////;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            ////
            //  w_2 = 0;
            //  pcA2 = cdVictim;
            //  D1W = Calculations.Quickness(pcA2);
            //  D7W = 100 - D1W;
            //  D5W = Calculations.STRandom(8);
			  
            //  //is victim lucky?
            //  while ( (D7W>0) && !Calculations.IsCharacterLucky(pcA2,D7W) )
            //  {
            //    //? globalni promenna ceho?
            //    D6W = d.uByte13126[D5W];
            //    if (D6W == 13)
            //    {
            //        // pick randomly simething from inventory? 17???
            //      D6W = D6W + Calculations.STRandom(17);
            //    };
            //    objD4 = pcA2.Inventory.GetItemAtPosition((CarryLocations)D6W);
            //    if (objD4 != RNnul)
            //    {
            //        //odejmi predmet obeti
            //      w_2 = 1;
            //      objD4 = RemoveCharacterPossession(chIdx, D6W);
				  
            //      //dej ho utocnikovi
            //      if (pDB4->possession() == RNeof)
            //      {
            //        pDB4->possession(objD4);
            //      }
            //      else
            //      {
            //        AddObjectToRoom(objD4, pDB4->possession(), -1, 0, NULL);
            //      };
            //      DrawCharacterState(chIdx);
            //    };
            //    D5W = (D5W + 1) & 7;
            //    D7W -= 20;

            //  };
            //  D0W = STRandom(8);
            ////
            //  if ( (STRandom(8)==0) || ((w_2!=0) && (STRandomBool()!=0)) )
            //  {
            //    D0W = STRandom(64) + 20;
            //    //ASSERT(pDB4->groupIndex() < d.MaxITEM16,"maxitem16");
            //    d.Item16[pDB4->groupIndex()].uByte5 = D0B;
            //    //30OCT02SETWBITS0_3(pDB4->word14, 5);
				
            //    //utocnik ma nastavem velky fear....coz my asi delat nebudeme
            //    pDB4->fear(StateOfFear5);
            //  };			
        }
    }
}
